<#assign base=request.contextPath />

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>登录</title>
    <!-- Bootstrap -->
    <link href="${base}/plugins/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="${base}/css/login.css" rel="stylesheet">

    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>
<body>
<div class="container" id="app" v-cloak>
    <div>
        <a class="btn" href="${base}">回到首页</a>
    </div>

    <div class="container" style="padding-top:100px;background-color:#eee;">
        <form class="form-signin" style="-webkit-box-shadow:0 0 10px rgba(0, 0, 0, .3);
                                         -moz-box-shadow:0 0 10px rgba(0, 0, 0, .3);
                                         box-shadow:0 0 10px rgba(0, 0, 0, .3);">
            <h3 class="form-signin-heading">用户登录</h3>
            <div class="form-group " :class="{'has-error has-feedback':usernameError!=''}">
                <label for="username" class="sr-only">用户名/手机号</label>
                <input type="text" id="username" class="form-control" placeholder="用户名/手机号"
                       required v-model="username">
                <span class="help-block" v-if="usernameError!=''">{{usernameError}}</span>
                <span class="glyphicon glyphicon-remove form-control-feedback"></span>
            </div>

            <div class="form-group" :class="{'has-error has-feedback':passwordError!=''}">
                <label for="Password" class="sr-only">密码</label>
                <input type="password" id="Password" class="form-control" placeholder="密码" required v-model="password">
                <span class="help-block">{{passwordError}}</span>
                <span class="glyphicon glyphicon-remove form-control-feedback"></span>
            </div>

            <div class="checkbox">
                <label>
                    <input type="checkbox" value="remember-me" v-model="remember"> 记住我
                </label>
            </div>
            <button @click="login" class="btn btn-primary btn-block" type="button">登 录</button>
            <a class="btn  btn-primary btn-block register" href="${base}/users/register" type="button">没有账号？点我注册</a>
        </form>
    </div>
</div>

<#include 'footer.ftl'>
</body>


<script src="${base}/js/vuejs-2.5.16.js"></script>
<script src="${base}/js/axios-0.18.0.js"></script>
<script src="${base}/js/login.js" id="testScript" base="${base}"></script>

</html>